package com.itheima.job;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.constant.SetTimeConStant;
import com.itheima.job.config.QuartzManager;
import com.itheima.service.ModifyTimeJob;

/**
 * @author LiangTianQi
 * @describe
 * @date 2020/11/16 17:35
 */

/**
 * 修改定时器任务的时间
 */
@Service(interfaceClass = ModifyTimeJob.class)
public class ModifyTimeJobImpl implements ModifyTimeJob {

    //任务名称
    private static String jobName= SetTimeConStant.JOB_NAME;
    //任务组名称
    private static String jobGroupName = SetTimeConStant.JOB_GROUP_NAME;

    //触发器名称
    private static String triggerName = SetTimeConStant.TRIGGER_NAME;
    //触发器组名称
    private static String triggerGroupName = SetTimeConStant.TRIGGER_GROUP_NAME;


    public void modifyJobTime(String cron) {
        //从数据库中获取cron的值
        QuartzManager.modifyJobTime(jobName,jobGroupName,triggerName,triggerGroupName, cron);
    }

}

